/*
 * QE3e Qt Quick 3D Engine.
 * Copyright (C) 2010 Joris Vaillant and Mathieu Pujol 
 * <joris.vaillant@gmail.com>  <mathieu.pujol87@gmail.com>
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */


#ifndef QE3E_UTIL_H
#define QE3E_UTIL_H

// global
#include "qe3e_global.h"

namespace qe3e
{
  // Math functions
  template<int P>
  QE3E_EXPORT inline double pow(double value)
  {
    return pow<P-1>(value)*value;
  }

  template<>
  QE3E_EXPORT inline double pow<1>(double value)
  {
    return value;
  }

  template<>
  QE3E_EXPORT inline double pow<0>(double /* value */)
  {
    return 1.;
  }

  template <int V>
  struct QE3E_EXPORT TestPair
  {
    static const bool isPair = (V % 2 ? false : true);
  };
}

#endif // QE3E_UTIL_H
